<?php
namespace app\admin\validate;
use think\Validate;

class conf extends Validate{


    /*验证规则*/
    protected $rule = [
        'cname'=>'require|max:60|unique:conf',
        'ename'=>'require|max:60|unique:conf',
        'dt_type'=>'require|number',
        'cf_type'=>'require|number',
    ];


    /*信息提示*/
    protected $message = [
        'cname.require'=>'中文名称不能为空！',
        'cname.unique'=>'中文名称不能重复！',
        'ename.require'=>'英文名称不能为空',
        'ename.unique'=>'英文名称不能重复！',
    ];

    /*验证场景*/
    protected $scene = [
        'add'=>['cname','ename','dt_type','cf_type'],
        'edit'=>['cname','ename','dt_type','cf_type'],
    ];


}
